package com.bdqn.service.Impl;
import com.bdqn.entity.Supplier;
import com.bdqn.mapper.SupplierMapper;
import com.bdqn.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SupplierServiceImpl implements SupplierService {

    @Autowired
    SupplierMapper supplierMapper ;
    @Override
    public List<Supplier> getListSupplier(Integer page, Integer limit) {
        page = (page - 1) * limit;
        return supplierMapper.getListSupplier(page,limit);
    }

    @Override
    public List<Supplier> getListSupplierInfo(Integer page, Integer limit, String supplierId, String name,String startDate,String endDate) {
        page = (page - 1) * limit;
        return supplierMapper.getListSupplierInfo(page,limit,supplierId,name,startDate,endDate);
    }

    @Override
    public Integer count(String supplierId, String name) {
        return supplierMapper.count(supplierId,name);
    }

    @Override
    public Integer addData(String supplierId, String supplierName) {
        return supplierMapper.addData(supplierId,supplierName);
    }

    @Override
    public int deletetSuppLierMapper(int id) {
        return supplierMapper.deletetSuppLierMapper(id);
    }



    @Override
    public Integer updateData(Supplier supplier) {
        return supplierMapper.updateData(supplier);
    }

    @Override
    public List<Supplier> getSupplier() {
        return supplierMapper.getSupplier();
    }
}
